﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Engine.Graphics
{
    public struct VertexPosition4Texture : IVertexType
    {
        public Vector4 Position;
        public Vector2 TextureCoordinate;

        static readonly VertexDeclaration declaration;

        #region Static Constructor

        static VertexPosition4Texture()
        {

            VertexElement[] elements = new VertexElement[] { new VertexElement(0, VertexElementFormat.Vector4, VertexElementUsage.Position, 0), 
                                                             new VertexElement(16, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0) };
            declaration = new VertexDeclaration(elements);
            declaration.Name = "VertexPosition4Texture.VertexDeclaration";
            //d = declaration;
        }

 



        #endregion

        public VertexPosition4Texture(Vector4 position, Vector2 textureCoordinate)
        {
            Position = position;
            TextureCoordinate = textureCoordinate;
        }


        #region IVertexType Members

        public VertexDeclaration VertexDeclaration
        {
            get { return declaration; }
        }

        #endregion
    }
}
